Skip to content
This repository was archived by the owner on Jan 23, 2026. It is now read-only.

Try running unit tests on darwin#465

Merged
NickCao merged 3 commits intomainfrom
darwin
May 12, 2025
Merged

Try running unit tests on darwin#465
NickCao merged 3 commits intomainfrom
darwin

Conversation

@NickCao
Copy link
Copy Markdown
Collaborator

@NickCao NickCao commented May 9, 2025

Summary by CodeRabbit

  • Chores
    • Updated test workflow to run on both Ubuntu and macOS environments.
    • Improved workflow steps to ensure Qemu is only installed on compatible OS runners.
    • Enhanced test client connection to target the correct server port for improved reliability.
  • New Features
    • Restricted certain QEMU device and network setups to Linux platforms only.

@netlify
Copy link
Copy Markdown

netlify Bot commented May 9, 2025

Deploy Preview for jumpstarter-docs ready!

Name Link
🔨 Latest commit 34a82ac
🔍 Latest deploy log https://app.netlify.com/sites/jumpstarter-docs/deploys/6821f84a980b3800082511b0
😎 Deploy Preview https://deploy-preview-465--jumpstarter-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 9, 2025

Walkthrough

The pytest workflow was updated to run tests on both Ubuntu 24.04 and macOS 15 by introducing a matrix for operating systems. The Qemu installation step was split into OS-specific commands to run only on Linux or macOS accordingly. The TFTP test client was fixed to connect to the server's actual port instead of port 0. The QEMU driver was modified to conditionally include vsock-related devices and networks only on Linux platforms.

Changes

File(s) Change Summary
.github/workflows/pytest.yaml Updated to use a matrix for OS runners (Ubuntu 24.04 and macOS 15); Qemu installation split into Linux and macOS steps.
packages/jumpstarter-driver-tftp/.../server_test.py Modified create_test_client to use the server's actual port for UDP endpoint remote address instead of port 0.
packages/jumpstarter-driver-qemu/jumpstarter_driver_qemu/driver.py Added _vsock_available() helper to detect Linux; conditionally include vsock device and network only on Linux in QemuPower and Qemu classes.

Poem

Across the fields of code I hop,
Two OS hills, I leap atop—
Ubuntu and Mac, together they run,
Qemu on Linux, macOS gets none.
TFTP ports now properly set,
Testing’s smooth without a fret!
🐇✨

Tip

⚡️ Faster reviews with caching
  • CodeRabbit now supports caching for code and dependencies, helping speed up reviews. This means quicker feedback, reduced wait times, and a smoother review experience overall. Cached data is encrypted and stored securely. This feature will be automatically enabled for all accounts on May 16th. To opt out, configure Review - Disable Cache at either the organization or repository level. If you prefer to disable all data retention across your organization, simply turn off the Data Retention setting under your Organization Settings.

Enjoy the performance boost—your workflow just got faster.


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between d0e66a8 and 34a82ac.

📒 Files selected for processing (3)
  • .github/workflows/pytest.yaml (3 hunks)
  • packages/jumpstarter-driver-qemu/jumpstarter_driver_qemu/driver.py (3 hunks)
  • packages/jumpstarter-driver-tftp/jumpstarter_driver_tftp/server_test.py (8 hunks)
🚧 Files skipped from review as they are similar to previous changes (3)
  • .github/workflows/pytest.yaml
  • packages/jumpstarter-driver-qemu/jumpstarter_driver_qemu/driver.py
  • packages/jumpstarter-driver-tftp/jumpstarter_driver_tftp/server_test.py
⏰ Context from checks skipped due to timeout of 90000ms (10)
  • GitHub Check: pytest-matrix (macos-15, 3.12)
  • GitHub Check: pytest-matrix (macos-15, 3.11)
  • GitHub Check: pytest-matrix (macos-15, 3.13)
  • GitHub Check: pytest-matrix (ubuntu-24.04, 3.11)
  • GitHub Check: pytest-matrix (ubuntu-24.04, 3.13)
  • GitHub Check: pytest-matrix (ubuntu-24.04, 3.12)
  • GitHub Check: e2e
  • GitHub Check: build-and-push-image (jumpstarter-dev/jumpstarter Dockerfile)
  • GitHub Check: build-and-push-image (jumpstarter-dev/jumpstarter-utils Dockerfile.utils)
  • GitHub Check: build-and-push-image (jumpstarter-dev/jumpstarter-devspace .devfile/Containerfile.client)
✨ Finishing Touches
  • 📝 Generate Docstrings

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (1)
.github/workflows/pytest.yaml (1)

15-15: Use a clear matrix key name for OS selection
Defining your matrix variable as runs-on works, but it can be confusing since runs-on is also a workflow keyword. Renaming it to something like os improves readability and separates data from DSL.

Apply this diff:

 strategy:
   matrix:
-    runs-on: [ubuntu-24.04, macos-15]
+    os: [ubuntu-24.04, macos-15]
     python-version: ["3.11", "3.12", "3.13"]
...
-runs-on: ${{ matrix.runs-on }}
+runs-on: ${{ matrix.os }}
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 9097f0d and 6483578.

📒 Files selected for processing (1)
  • .github/workflows/pytest.yaml (2 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (2)
  • GitHub Check: build-and-push-image (jumpstarter-dev/jumpstarter-devspace .devfile/Containerfile.client)
  • GitHub Check: build-and-push-image (jumpstarter-dev/jumpstarter-utils Dockerfile.utils)
🔇 Additional comments (2)
.github/workflows/pytest.yaml (2)

34-35: Conditional QEMU installation is correctly scoped
The if: runner.os == 'Linux' guard properly prevents Linux-only QEMU setup from running on macOS, avoiding permission or package-manager errors.


18-18:

Details

✅ Verification successful

Verify availability of specified runner labels
GitHub Actions periodically adds/removes virtual environments. Please confirm that ubuntu-24.04 and macos-15 are valid runner labels in your org. If not, consider using the maintained aliases ubuntu-latest/macos-latest to avoid CI failures.


🌐 Web query:

Do GitHub Actions runners support `ubuntu-24.04` and `macos-15` as selection labels?

💡 Result:

Support for ubuntu-24.04 and macos-15 Runner Labels in GitHub Actions

Ubuntu 24.04 Support

  • GitHub Actions now supports ubuntu-24.04 as a runner label for GitHub-hosted runners.
  • As of May 14, 2024, the Ubuntu 24.04 image entered public beta and can be explicitly selected in workflow YAML files using:
    runs-on: ubuntu-24.04
  • This enables you to test and migrate workflows to the new LTS version before the default ubuntu-latest label is updated to point to Ubuntu 24.04, which is scheduled to occur in late 2024 into early 2025[6][7][9].

macOS 15 Support

  • GitHub Actions supports macos-15 as a runner label for GitHub-hosted runners.
  • macOS 15 (Sequoia) became generally available as an image label for all GitHub Actions users in April 2025. You can select it in your workflow using:
    runs-on: macos-15
  • Both Apple Silicon and Intel variants exist, with label options like macos-15 and macos-15-xlarge[7][10].

Summary Table

Runner Label Supported? Notes
ubuntu-24.04 Yes Public beta since May 2024, will become default for ubuntu-latest in 2024–2025[6][7][9].
macos-15 Yes Generally available since April 2025; use macos-15 in workflow YAML[7][10].

You can safely use both ubuntu-24.04 and macos-15 in your GitHub Actions workflows to target the latest OS images on GitHub-hosted runners.

Citations:


GitHub Actions runner labels are valid
Both ubuntu-24.04 and macos-15 are supported on GitHub-hosted runners (Ubuntu 24.04 in public beta since May 2024 and macOS 15 generally available since April 2025). No changes needed.

@NickCao NickCao force-pushed the darwin branch 2 times, most recently from 9befbb5 to f0c8228 Compare May 9, 2025 18:22
Comment thread .github/workflows/pytest.yaml
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (1)
packages/jumpstarter-driver-qemu/jumpstarter_driver_qemu/driver.py (1)

30-32: Add a docstring to explain vsock availability

This helper function correctly checks if the platform is Linux, but it would benefit from a docstring explaining what vsock is and why it's only available on Linux platforms.

def _vsock_available():
+    """
+    Check if vsock functionality is available.
+    
+    vsock (Virtual Socket) is a Linux-specific socket family that allows communication
+    between virtual machines and the host. It is only available on Linux platforms.
+    """
    return platform.system() == "Linux"
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between f0c8228 and d0e66a8.

📒 Files selected for processing (3)
  • .github/workflows/pytest.yaml (3 hunks)
  • packages/jumpstarter-driver-qemu/jumpstarter_driver_qemu/driver.py (3 hunks)
  • packages/jumpstarter-driver-tftp/jumpstarter_driver_tftp/server_test.py (8 hunks)
🚧 Files skipped from review as they are similar to previous changes (2)
  • .github/workflows/pytest.yaml
  • packages/jumpstarter-driver-tftp/jumpstarter_driver_tftp/server_test.py
🧰 Additional context used
🧬 Code Graph Analysis (1)
packages/jumpstarter-driver-qemu/jumpstarter_driver_qemu/driver.py (1)
packages/jumpstarter-driver-network/jumpstarter_driver_network/driver.py (1)
  • VsockNetwork (114-147)
⏰ Context from checks skipped due to timeout of 90000ms (5)
  • GitHub Check: pytest-matrix (macos-15, 3.13)
  • GitHub Check: pytest-matrix (macos-15, 3.12)
  • GitHub Check: pytest-matrix (macos-15, 3.11)
  • GitHub Check: build-and-push-image (jumpstarter-dev/jumpstarter-utils Dockerfile.utils)
  • GitHub Check: build-and-push-image (jumpstarter-dev/jumpstarter-devspace .devfile/Containerfile.client)
🔇 Additional comments (1)
packages/jumpstarter-driver-qemu/jumpstarter_driver_qemu/driver.py (1)

135-137: LGTM: Correctly handles vsock device conditionally

The code now properly checks if vsock is available before adding the vhost-vsock-pci device. This is necessary for cross-platform compatibility.

Comment thread packages/jumpstarter-driver-qemu/jumpstarter_driver_qemu/driver.py
@NickCao NickCao enabled auto-merge May 12, 2025 13:32
@NickCao NickCao merged commit dc0c474 into main May 12, 2025
22 checks passed
@NickCao NickCao deleted the darwin branch May 12, 2025 13:43
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants